﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Collections;
using WCSY.MODEL;
using WCSY.DAL;

namespace WCSY.DAL
{
    public class BaseInfo_Svc
    {
        //#region 客户信息

        ///// <summary>
        ///// 添加客户信息
        ///// </summary>
        ///// <param name="htCi">客户信息数据模型</param>
        ///// <returns></returns>
        //public static int AddClientInfo(Hashtable htCi)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "INSERT INTO wcsy_ClientInfo " + "\n";
        //    sql = sql + "VALUES      ('" + htCi["ClientNo"] + "', " + "\n";
        //    sql = sql + "             '" + htCi["ClientName"] + "', " + "\n";
        //    sql = sql + "             '" + htCi["ContactMan"] + "', " + "\n";
        //    sql = sql + "             '" + htCi["ContactWay"] + "', " + "\n";
        //    sql = sql + "             '" + htCi["ClientArea"] + "', " + "\n";
        //    sql = sql + "             '" + htCi["ClientAddress"] + "') ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 删除对应代码的客户信息
        ///// </summary>
        ///// <param name="ClientNo">客户代码</param>
        ///// <returns></returns>
        //public static int DelClientInfoByNo(string ClientNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "DELETE wcsy_ClientInfo " + "\n";
        //    sql = sql + "WHERE  ClientNo = '" + ClientNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 修改对应代码的客户信息
        ///// </summary>
        ///// <param name="htCi">客户信息数据模型</param>
        ///// <returns></returns>
        //public static int ModifyClientInfoByNo(Hashtable htCi)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "UPDATE wcsy_ClientInfo " + "\n";
        //    sql = sql + "SET    ClientName = '" + htCi["ClientName"] + "', " + "\n";
        //    sql = sql + "       ContactMan = '" + htCi["ContactMan"] + "', " + "\n";
        //    sql = sql + "       ContactWay = '" + htCi["ContactWay"] + "', " + "\n";
        //    sql = sql + "       ClientArea = '" + htCi["ClientArea"] + "', " + "\n";
        //    sql = sql + "       ClientAddress = '" + htCi["ClientAddress"] + "' ";
        //    sql = sql + "WHERE  ClientNo = '" + htCi["ClientNo"] + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 通过客户代码获取客户信息
        ///// </summary>
        ///// <param name="ClientNo">客户代码</param>
        ///// <returns></returns>
        //public static Hashtable GetClientInfoByNo(string ClientNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_ClientInfo " + "\n";
        //    sql = sql + "WHERE  ClientNo = '" + ClientNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    if (dt.Rows.Count > 0)
        //    {
        //        Hashtable htCi = new Hashtable();
        //        htCi["ClientNo"] = dt.Rows[0][0];
        //        htCi["ClientName"] = dt.Rows[0][1];
        //        htCi["ContactMan"] = dt.Rows[0][2];
        //        htCi["ContactWay"] = dt.Rows[0][3];
        //        htCi["ClientArea"] = dt.Rows[0][4];
        //        htCi["ClientAddress"] = dt.Rows[0][5];

        //        return htCi;
        //    }
        //    else
        //        return null;
        //}
        ///// <summary>
        ///// 通过查询条件获取相关客户信息
        ///// </summary>
        ///// <param name="htCi">查询条件</param>
        ///// <returns></returns>
        //public static DataTable GetClientInfoByCdt(Hashtable htCi)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_ClientInfo " + "\n";
        //    sql = sql + "WHERE  1 = 1 " + "\n";

        //    if (htCi["ClientNo"] != null && htCi["ClientNo"].ToString() != "")
        //        sql = sql + "       AND ClientNo = '" + htCi["ClientNo"] + "' " + "\n";

        //    if (htCi["ClientName"] != null && htCi["ClientName"].ToString() != "")
        //        sql = sql + "       AND ClientName LIKE '%" + htCi["ClientName"] + "%' " + "\n";

        //    if (htCi["ContactMan"] != null && htCi["ContactMan"].ToString() != "")
        //        sql = sql + "       AND ContactMan LIKE '%" + htCi["ContactMan"] + "%' " + "\n";

        //    if (htCi["ContactWay"] != null && htCi["ContactWay"].ToString() != "")
        //        sql = sql + "       AND ContactWay LIKE '%" + htCi["ContactWay"] + "%' " + "\n";

        //    if (htCi["ClientArea"] != null && htCi["ClientArea"].ToString() != "")
        //        sql = sql + "       AND ClientArea LIKE '%" + htCi["ClientArea"] + "%' " + "\n";

        //    if (htCi["ClientAddress"] != null && htCi["ClientAddress"].ToString() != "")
        //        sql = sql + "       AND ClientAddress = '" + htCi["ClientAddress"] + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    return dt;
        //}
        ///// <summary>
        ///// 获取最大客户代码
        ///// </summary>
        ///// <returns></returns>
        //public static String GetMaxCNo()
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT Max(ClientNo) + 1 " + "\n";
        //    sql = sql + "FROM   wcsy_ClientInfo ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    object obj = db.ExecuteScalar(com);
        //    string MaxNo = obj == null ? "" : obj.ToString();
        //    string temp = "000000";

        //    return temp.Substring(0, 5 - MaxNo.Length) + MaxNo;
        //}

        //#endregion

        //#region 产品类型

        ///// <summary>
        ///// 添加产品类型
        ///// </summary>
        ///// <param name="htPt">产品类型数据模型</param>
        ///// <returns></returns>
        //public static int AddProductType(Hashtable htPt)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "INSERT INTO wcsy_ProductType " + "\n";
        //    sql = sql + "VALUES      ('" + htPt["ProdTypeNo"] + "', " + "\n";
        //    sql = sql + "             '" + htPt["ProdTypeName"] + "') ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 删除对应代码的产品类型
        ///// </summary>
        ///// <param name="ProdTpNo">产品类型代码</param>
        ///// <returns></returns>
        //public static int DelProductTypeByNo(string ProdTpNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "DELETE wcsy_ProductType " + "\n";
        //    sql = sql + "WHERE  ProdTypeNo = '" + ProdTpNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 修改对应代码的产品类型信息
        ///// </summary>
        ///// <param name="htPt">产品类型数据模型</param>
        ///// <returns></returns>
        //public static int ModifyProductTypeByNo(Hashtable htPt)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "UPDATE wcsy_ProductType " + "\n";
        //    sql = sql + "SET    ProdTypeName = '" + htPt["ProdTypeName"] + "' ";
        //    sql = sql + "WHERE  ProdTypeNo = '" + htPt["ProdTypeNo"] + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 获取对应代码的产品类型信息
        ///// </summary>
        ///// <param name="ProdTpNo">产品类型代码</param>
        ///// <returns></returns>
        //public static Hashtable GetProductTypeByNo(string ProdTpNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_ProductType " + "\n";
        //    sql = sql + "WHERE  ProdTypeNo = '" + ProdTpNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    if (dt.Rows.Count > 0)
        //    {
        //        Hashtable htPt = new Hashtable();
        //        htPt["ProdTypeNo"] = dt.Rows[0][0];
        //        htPt["ProdTypeName"] = dt.Rows[0][1];

        //        return htPt;
        //    }
        //    else
        //        return null;
        //}
        ///// <summary>
        ///// 查询产品类型信息
        ///// </summary>
        ///// <param name="htPt">查询条件</param>
        ///// <returns></returns>
        //public static DataTable GetProductTypeByCdt(Hashtable htPt)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_ProductType " + "\n";
        //    sql = sql + "WHERE  1 = 1 " + "\n";

        //    if (htPt["ProdTypeNo"] != null && htPt["ProdTypeNo"].ToString() != "")
        //        sql = sql + "       AND ProdTypeNo = '" + htPt["ProdTypeNo"] + "' " + "\n";

        //    if (htPt["ProdTypeName"] != null && htPt["ProdTypeName"].ToString() != "")
        //        sql = sql + "       AND ProdTypeName = '" + htPt["ProdTypeName"] + "' " + "\n";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    return dt;
        //}

        //#endregion

        //#region 产品型号

        ///// <summary>
        ///// 添加产品型号
        ///// </summary>
        ///// <param name="htPm">产品型号数据模型</param>
        ///// <returns></returns>
        //public static int AddProductModel(Hashtable htPm)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "INSERT INTO wcsy_ProductModel " + "\n";
        //    sql = sql + "VALUES      ('" + htPm["ProdModelNo"] + "', " + "\n";
        //    sql = sql + "             '" + htPm["ProdModelName"] + "', " + "\n";
        //    sql = sql + "             '" + htPm["ProdSeries"] + "', " + "\n";
        //    sql = sql + "             '" + htPm["BelongType"] + "') ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 删除对应代码的产品型号
        ///// </summary>
        ///// <param name="ProdMdNo">产品型号代码</param>
        ///// <returns></returns>
        //public static int DelProductModelByNo(string ProdMdNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "DELETE wcsy_ProductModel " + "\n";
        //    sql = sql + "WHERE  ProdModelNo = '" + ProdMdNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 修改对应代码的产品型号信息
        ///// </summary>
        ///// <param name="htPm">产品型号数据模型</param>
        ///// <returns></returns>
        //public static int ModifyProductModelByNo(Hashtable htPm)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "UPDATE wcsy_ProductModel " + "\n";
        //    sql = sql + "SET    ProdModelName = '" + htPm["ProdModelName"] + "', " + "\n";
        //    sql = sql + "       ProdSeries = '" + htPm["ProdSeries"] + "', ";
        //    sql = sql + "       BelongType = '" + htPm["BelongType"] + "' ";
        //    sql = sql + "WHERE  ProdModelNo = '" + htPm["ProdModelNo"] + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 获取对应代码的产品型号信息
        ///// </summary>
        ///// <param name="ProdPmNo">产品型号代码</param>
        ///// <returns></returns>
        //public static Hashtable GetProductModelByNo(string ProdPmNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_ProductModel " + "\n";
        //    sql = sql + "WHERE  ProdModelNo = '" + ProdPmNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);
        //    if (dt.Rows.Count > 0)
        //    {
        //        Hashtable htPm = new Hashtable();
        //        htPm["ProdModelNo"] = dt.Rows[0][0];
        //        htPm["ProdModelName"] = dt.Rows[0][1];
        //        htPm["ProdSeries"] = dt.Rows[0][2];
        //        htPm["BelongType"] = dt.Rows[0][3];

        //        return htPm;
        //    }
        //    else
        //        return null;
        //}
        ///// <summary>
        ///// 查询产品型号信息
        ///// </summary>
        ///// <param name="htPm">查询条件</param>
        ///// <returns></returns>
        //public static DataTable GetProductModelByCdt(Hashtable htPm)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_ProductModel " + "\n";
        //    sql = sql + "WHERE  1 = 1 " + "\n";

        //    if (htPm["ProdModelNo"] != null && htPm["ProdModelNo"].ToString() != "")
        //        sql = sql + "       AND ProdModelNo = '" + htPm["ProdModelNo"] + "' " + "\n";

        //    if (htPm["ProdModelName"] != null && htPm["ProdModelName"].ToString() != "")
        //        sql = sql + "       AND ProdModelName = '" + htPm["ProdModelName"] + "' " + "\n";

        //    if (htPm["ProdSeries"] != null && htPm["ProdSeries"].ToString() != "")
        //        sql = sql + "       AND ProdSeries = '" + htPm["ProdSeries"] + "' " + "\n";

        //    if (htPm["BelongType"] != null && htPm["BelongType"].ToString() != "")
        //        sql = sql + "       AND BelongType = '" + htPm["BelongType"] + "' " + "\n";

        //    sql = sql + "ORDER  BY ProdModelName ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    return dt;
        //}

        //#endregion

        //#region 需求类别

        ///// <summary>
        ///// 添加需求类别
        ///// </summary>
        ///// <param name="htRt">需求类别数据模型</param>
        ///// <returns></returns>
        //public static int AddRequireType(Hashtable htRt)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "INSERT INTO wcsy_RequireType " + "\n";
        //    sql = sql + "VALUES      ('" + htRt["ReqTypeNo"] + "', " + "\n";
        //    sql = sql + "             '" + htRt["ReqTypeName"] + "') ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 删除对应代码的需求类别
        ///// </summary>
        ///// <param name="ReqTpNo">需求类别代码</param>
        ///// <returns></returns>
        //public static int DelRequireTypeByNo(string ReqTpNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "DELETE wcsy_RequireType " + "\n";
        //    sql = sql + "WHERE  ReqTypeNo = '" + ReqTpNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 修改对应代码的需求类别信息
        ///// </summary>
        ///// <param name="htRt">需求类别数据模型</param>
        ///// <returns></returns>
        //public static int ModifyRequireTypeByNo(Hashtable htRt)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "UPDATE wcsy_RequireType " + "\n";
        //    sql = sql + "SET    ReqTypeName = '" + htRt["ReqTypeName"] + "' ";
        //    sql = sql + "WHERE  ReqTypeNo = '" + htRt["ReqTypeNo"] + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 获取对应代码的需求类别信息
        ///// </summary>
        ///// <param name="ReqTpNo">需求类别代码</param>
        ///// <returns></returns>
        //public static Hashtable GetRequireTypeByNo(string ReqTpNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_RequireType " + "\n";
        //    sql = sql + "WHERE  ReqTypeNo = '" + ReqTpNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    if (dt.Rows.Count > 0)
        //    {
        //        Hashtable htRt = new Hashtable();
        //        htRt["ReqTypeNo"] = dt.Rows[0][0];
        //        htRt["ReqTypeName"] = dt.Rows[0][1];

        //        return htRt;
        //    }
        //    else
        //        return null;
        //}
        ///// <summary>
        ///// 查询需求类别信息
        ///// </summary>
        ///// <param name="htRt">查询条件</param>
        ///// <returns></returns>
        //public static DataTable GetRequireTypeByCdt(Hashtable htRt)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_RequireType " + "\n";
        //    sql = sql + "WHERE  1 = 1 " + "\n";

        //    if (htRt["ReqTypeNo"] != null && htRt["ReqTypeNo"].ToString() != "")
        //        sql = sql + "       AND ReqTypeNo = '" + htRt["ReqTypeNo"] + "' " + "\n";

        //    if (htRt["ReqTypeName"] != null && htRt["ReqTypeName"].ToString() != "")
        //        sql = sql + "       AND ReqTypeName = '" + htRt["ReqTypeName"] + "' " + "\n";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    return dt;
        //}

        //#endregion

        //#region 处理状态

        ///// <summary>
        ///// 添加处理状态
        ///// </summary>
        ///// <param name="htDs">处理状态数据模型</param>
        ///// <returns></returns>
        //public static int AddDealStatus(Hashtable htDs)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "INSERT INTO wcsy_DealStatus " + "\n";
        //    sql = sql + "VALUES      ('" + htDs["DealStaNo"] + "', " + "\n";
        //    sql = sql + "             '" + htDs["DealStaName"] + "') ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 删除对应代码的处理状态
        ///// </summary>
        ///// <param name="DealStaNo">处理状态代码</param>
        ///// <returns></returns>
        //public static int DelDealStatusByNo(string DealStaNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "DELETE wcsy_DealStatus " + "\n";
        //    sql = sql + "WHERE  DealStaNo = '" + DealStaNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 修改对应代码的处理状态信息
        ///// </summary>
        ///// <param name="htDs">处理状态数据模型</param>
        ///// <returns></returns>
        //public static int ModifyDealStatusByNo(Hashtable htDs)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "UPDATE wcsy_DealStatus " + "\n";
        //    sql = sql + "SET    DealStaName = '" + htDs["DealStaName"] + "' ";
        //    sql = sql + "WHERE  DealStaNo = '" + htDs["DealStaNo"] + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 获取对应代码的处理状态信息
        ///// </summary>
        ///// <param name="DealStaNo">处理状态代码</param>
        ///// <returns></returns>
        //public static Hashtable GetDealStatusByNo(string DealStaNo)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_DealStatus " + "\n";
        //    sql = sql + "WHERE  DealStaNo = '" + DealStaNo + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    if (dt.Rows.Count > 0)
        //    {
        //        Hashtable htDs = new Hashtable();
        //        htDs["DealStaNo"] = dt.Rows[0][0];
        //        htDs["DealStaName"] = dt.Rows[0][1];

        //        return htDs;
        //    }
        //    else
        //        return null;
        //}
        ///// <summary>
        ///// 查询需求处理状态
        ///// </summary>
        ///// <param name="htDs">查询条件</param>
        ///// <returns></returns>
        //public static DataTable GetDealStatusByCdt(Hashtable htDs)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_DealStatus " + "\n";
        //    sql = sql + "WHERE  1 = 1 " + "\n";

        //    if (htDs["DealStaNo"] != null && htDs["DealStaNo"].ToString() != "")
        //        sql = sql + "       AND DealStaNo = '" + htDs["DealStaNo"] + "' " + "\n";

        //    if (htDs["DealStaName"] != null && htDs["DealStaName"].ToString() != "")
        //        sql = sql + "       AND DealStaName = '" + htDs["DealStaName"] + "' " + "\n";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    return dt;
        //}

        //#endregion

        #region 审批流程

        /// <summary>
        /// 添加审批流程
        /// </summary>
        /// <param name="htAf">审批流程数据模型</param>
        /// <returns></returns>
        public static int AddApprovalFlow(Hashtable htAf)
        {
            

            String sql = "";
            sql = sql + "INSERT INTO wcsy_ApprovalFlow " + "\n";
            sql = sql + "VALUES      ('" + htAf["ReceiptType"] + "', " + "\n";
            sql = sql + "             '" + htAf["ApprovalPsn"] + "', " + "\n";
            sql = sql + "             '" + htAf["ApprovalLevel"] + "', " + "\n";
            sql = sql + "             '" + htAf["ApprovalField"] + "', " + "\n";
            sql = sql + "             '" + htAf["ApprovalFieldCName"] + "', " + "\n";
            sql = sql + "             '" + htAf["ApprovalOperator"] + "', " + "\n";
            sql = sql + "             '" + htAf["ApprovalOperatorCName"] + "', " + "\n";
            sql = sql + "             '" + htAf["ApprovalCondition"] + "') ";

           
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 删除对应代码的审批流程
        /// </summary>
        /// <param name="AprvlNo">审批流程代码</param>
        /// <returns></returns>
        public static int DelApprovalFlowByNo(string AprvlNo)
        {
            

            String sql = "";
            sql = sql + "DELETE wcsy_ApprovalFlow " + "\n";
            sql = sql + "WHERE  ApprovalNo = '" + AprvlNo + "' ";

           
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 修改对应代码的审批流程
        /// </summary>
        /// <param name="htAf">审批流程数据模型</param>
        /// <returns></returns>
        public static int ModifyApprovalFlowByNo(Hashtable htAf)
        {
            

            String sql = "";
            sql = sql + "UPDATE wcsy_ApprovalFlow " + "\n";
            sql = sql + "SET    ReceiptType = '" + htAf["ReceiptType"] + "', " + "\n";
            sql = sql + "       ApprovalPsn = '" + htAf["ApprovalPsn"] + "', " + "\n";
            sql = sql + "       ApprovalLevel = '" + htAf["ApprovalLevel"] + "', " + "\n";
            sql = sql + "       ApprovalField = '" + htAf["ApprovalField"] + "', " + "\n";
            sql = sql + "       ApprovalFieldCName = '" + htAf["ApprovalFieldCName"] + "', " + "\n";
            sql = sql + "       ApprovalOperator = '" + htAf["ApprovalOperator"] + "', " + "\n";
            sql = sql + "       ApprovalOperatorCName = '" + htAf["ApprovalOperatorCName"] + "', " + "\n";
            sql = sql + "       ApprovalCondition = '" + htAf["ApprovalCondition"] + "' ";
            sql = sql + "WHERE  ApprovalNo = '" + htAf["ApprovalNo"] + "' ";

            
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 通过客户代码获取审批流程
        /// </summary>
        /// <param name="AprvlNo">审批流程代码</param>
        /// <returns></returns>
        public static Hashtable GetApprovalFlowByNo(string AprvlNo)
        {
           

            String sql = "";
            sql = sql + "SELECT af.*, " + "\n";
            sql = sql + "       ea.IsApproval " + "\n";
            sql = sql + "FROM   wcsy_ApprovalFlow af " + "\n";
            sql = sql + "       LEFT JOIN wcsy_EnableApproval ea " + "\n";
            sql = sql + "         ON af.ReceiptType = ea.ReceiptType ";
            sql = sql + "WHERE  ApprovalNo = '" + AprvlNo + "' ";

           
            DataTable dt = DBHelper.GetDataTable(sql);

            if (dt.Rows.Count > 0)
            {
                Hashtable htAf = new Hashtable();
                htAf["ApprovalNo"] = dt.Rows[0][0];
                htAf["ReceiptType"] = dt.Rows[0][1];
                htAf["ApprovalPsn"] = dt.Rows[0][2];
                htAf["ApprovalLevel"] = dt.Rows[0][3];
                htAf["ApprovalField"] = dt.Rows[0][4];
                htAf["ApprovalFieldCName"] = dt.Rows[0][5];
                htAf["ApprovalOperator"] = dt.Rows[0][6];
                htAf["ApprovalOperatorCName"] = dt.Rows[0][7];
                htAf["ApprovalCondition"] = dt.Rows[0][8];
                htAf["IsApproval"] = dt.Rows[0][9];

                return htAf;
            }
            else
                return null;
        }
        /// <summary>
        /// 通过查询条件获取相关审批流程
        /// </summary>
        /// <param name="htAf">查询条件</param>
        /// <returns></returns>
        public static DataTable GetApprovalFlowByCdt(Hashtable htAf)
        {
            
            String sql = "";
            sql = sql + "SELECT af.*, " + "\n";
            sql = sql + "       ea.IsApproval " + "\n";
            sql = sql + "FROM   wcsy_ApprovalFlow af " + "\n";
            sql = sql + "       LEFT JOIN wcsy_EnableApproval ea " + "\n";
            sql = sql + "         ON af.ReceiptType = ea.ReceiptType ";
            sql = sql + "WHERE  1 = 1 " + "\n";

            if (htAf["ReceiptType"] != null && htAf["ReceiptType"].ToString() != "")
                sql = sql + "       AND af.ReceiptType = '" + htAf["ReceiptType"] + "' " + "\n";

            if (htAf["ApprovalPsn"] != null && htAf["ApprovalPsn"].ToString() != "")
                sql = sql + "       AND af.ApprovalPsn LIKE '%" + htAf["ApprovalPsn"] + "%' " + "\n";

            if (htAf["ApprovalLevel"] != null && htAf["ApprovalLevel"].ToString() != "")
                sql = sql + "       AND af.ApprovalLevel = '" + htAf["ApprovalLevel"] + "' " + "\n";

            if (htAf["ApprovalField"] != null && htAf["ApprovalField"].ToString() != "")
                sql = sql + "       AND af.ApprovalField = '" + htAf["ApprovalField"] + "' " + "\n";

            if (htAf["ApprovalOperator"] != null && htAf["ApprovalOperator"].ToString() != "")
                sql = sql + "       AND af.ApprovalOperator = '" + htAf["ApprovalOperator"] + "' ";

            if (htAf["ApprovalCondition"] != null && htAf["ApprovalCondition"].ToString() != "")
                sql = sql + "       AND af.ApprovalCondition = '" + htAf["ApprovalCondition"] + "' ";

            if (htAf["IsApproval"] != null && htAf["IsApproval"].ToString() != "")
                sql = sql + "       AND ea.IsApproval = '" + htAf["IsApproval"] + "' ";

            
            DataTable dt = DBHelper.GetDataTable(sql);

            return dt;
        }
        /// <summary>
        /// 查询表对应的字段
        /// </summary>
        /// <param name="tbName">表名</param>
        /// <returns></returns>
        public static DataTable GetApprovalField(string tbName)
        {
            

            String sql = "";
            sql = sql + "SELECT 表列名, " + "\n";
            sql = sql + "       列中文 " + "\n";
            sql = sql + "FROM   wcsy_ctl_tbl " + "\n";
            sql = sql + "WHERE  表中文 LIKE '%" + tbName + "%' ";


           
            DataTable dt = DBHelper.GetDataTable(sql);

            return dt;
        }

        #endregion

        #region 是否启用审批

        /// <summary>
        /// 添加是否启用审批
        /// </summary>
        /// <param name="htEa">是否启用审批数据模型</param>
        /// <returns></returns>
        public static int AddEnableApproval(Hashtable htEa)
        {
           

            String sql = "";
            sql = sql + "INSERT INTO wcsy_EnableApproval " + "\n";
            sql = sql + "VALUES      ('" + htEa["ReceiptType"] + "', " + "\n";
            sql = sql + "             '" + htEa["IsApproval"] + "') ";

            
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 删除是否启用审批
        /// </summary>
        /// <param name="ReceiptType">单据类型</param>
        /// <returns></returns>
        public static int DelEnableApproval(string ReceiptType)
        {
            

            String sql = "";
            sql = sql + "DELETE wcsy_EnableApproval " + "\n";
            sql = sql + "WHERE  ReceiptType = '" + ReceiptType + "' ";

            
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 修改单据是否启用审批
        /// </summary>
        /// <param name="htEa">是否启用审批数据模型</param>
        /// <returns></returns>
        public static int ModifyEnableApproval(Hashtable htEa)
        {
            

            String sql = "";
            sql = sql + "UPDATE wcsy_EnableApproval " + "\n";
            sql = sql + "SET    IsApproval = '" + htEa["IsApproval"] + "' " + "\n";
            sql = sql + "WHERE  ReceiptType = '" + htEa["ReceiptType"] + "' ";

            
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 查询单据是否启用审批
        /// </summary>
        /// <param name="ReceiptType">单据类型</param>
        /// <returns></returns>
        public static string GetEnableApproval(string ReceiptType)
        {
            
            String sql = "";
            sql = sql + "SELECT IsApproval " + "\n";
            sql = sql + "FROM   wcsy_EnableApproval " + "\n";
            sql = sql + "WHERE  ReceiptType = '" + ReceiptType + "' ";

            
            object IsApproval = DBHelper.GetSingle(sql);

            return IsApproval == null ? "" : IsApproval.ToString(); ;
        }

        #endregion

        #region 审批

        /// <summary>
        /// 添加审批
        /// </summary>
        /// <param name="htAprvl">审批数据模型</param>
        /// <returns></returns>
        public static int AddApproval(Hashtable htAprvl)
        {
            
            String sql = "";
            sql = sql + "INSERT INTO wcsy_Approval " + "\n";
            sql = sql + "VALUES      ('" + htAprvl["SysNo"] + "', " + "\n";
            sql = sql + "             '" + htAprvl["ReceiptFlg"] + "', " + "\n";
            sql = sql + "             '" + htAprvl["SubmitPsn"] + "', " + "\n";
            sql = sql + "             '" + htAprvl["SubmitDt"] + "', " + "\n";
            sql = sql + "             '" + htAprvl["AprvlPsn"] + "', " + "\n";
            sql = sql + "             NULL, " + "\n";
            sql = sql + "             '" + htAprvl["AprvlStatus"] + "', " + "\n";
            sql = sql + "             '" + htAprvl["AprvlLvl"] + "') ";

            
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 删除审批
        /// </summary>
        /// <param name="htAprvl">单据标志，单据号</param>
        /// <returns></returns>
        public static int DelApproval(Hashtable htAprvl)
        {
           

            String sql = "";
            sql = sql + "DELETE wcsy_Approval " + "\n";
            sql = sql + "WHERE  SysNo = '" + htAprvl["SysNo"] + "' ";
            sql = sql + "       AND ReceiptFlg = '" + htAprvl["ReceiptFlg"] + "' " + "\n";
            
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 修改审批状态
        /// </summary>
        /// <param name="htAprvl">单据标志，单据号</param>
        /// <returns></returns>
        public static int ModifyAprvlStatus(Hashtable htAprvl)
        {
            

            String sql = "";
            sql = sql + "UPDATE wcsy_Approval " + "\n";
            sql = sql + "SET    AprvlStatus = '" + htAprvl["AprvlStatus"] + "' " + "\n";
            sql = sql + "WHERE  SysNo = '" + htAprvl["SysNo"] + "' ";
            sql = sql + "       AND ReceiptFlg = '" + htAprvl["ReceiptFlg"] + "' " + "\n";
            sql = sql + "       AND AprvlPsn = '" + htAprvl["AprvlPsn"] + "' " + "\n";
            
            int i = DBHelper.ExecuteCommand(sql);

            return i;
        }
        /// <summary>
        /// 获取审批单据
        /// </summary>
        /// <param name="htAprvl">审批状态，单据号</param>
        /// <returns></returns>
        public static DataTable GetApproverReceipt(Hashtable htAprvl)
        {
            
            String sql = "";
            sql = sql + "SELECT rc.* " + "\n";
            sql = sql + "FROM  (SELECT * " + "\n";
            sql = sql + "       FROM   wcsy_Approval " + "\n";
            sql = sql + "       WHERE  AprvlStatus = '" + htAprvl["AprvlStatus"] + "' " + "\n";
            sql = sql + "              AND ReceiptFlg = '" + htAprvl["ReceiptFlg"] + "' " + "\n";

            if (htAprvl["AprvlPsn"] != null && htAprvl["AprvlPsn"].ToString() != "")
                sql = sql + "              AND AprvlPsn = '" + htAprvl["AprvlPsn"] + "' " + "\n";
            
            //如果状态为2，即是去审批
            if (htAprvl["AprvlStatus"] != null && htAprvl["AprvlStatus"].ToString() != "2")
            {
                sql = sql + "              AND SysNo NOT IN (SELECT SysNo " + "\n";
                sql = sql + "                                FROM   wcsy_Approval " + "\n";
                sql = sql + "                                WHERE  AprvlStatus = 2 " + "\n";
                sql = sql + "                                       AND ReceiptFlg = '" + htAprvl["ReceiptFlg"] + "') " + "\n";
            }

            sql = sql + "              AND SysNo + ReceiptFlg + AprvlLvl IN (SELECT SysNo + ReceiptFlg + Min(AprvlLvl) AprvlLvl " + "\n";
            sql = sql + "                                                    FROM   wcsy_Approval " + "\n";
            sql = sql + "                                                    WHERE  AprvlStatus = '" + htAprvl["AprvlStatus"] + "' " + "\n";
            sql = sql + "                                                           AND ReceiptFlg = '" + htAprvl["ReceiptFlg"] + "' " + "\n";
            sql = sql + "                                                    GROUP  BY SysNo, " + "\n";
            sql = sql + "                                                              ReceiptFlg)) ap " + "\n";
            sql = sql + "      LEFT JOIN wcsy_SaleInfo rc " + "\n";
            sql = sql + "        ON ap.SysNo = rc.SysNo " + "\n";
            sql = sql + "WHERE  1=1 " + "\n";

            if (htAprvl["SSysDt"] != null && htAprvl["SSysDt"].ToString()!="")
                sql = sql + "       AND SysDt >= '" + htAprvl["SSysDt"] + "' " + "\n";

            if (htAprvl["ESysDt"] != null && htAprvl["ESysDt"].ToString() != "")
                sql = sql + "       AND SysDt <= '" + htAprvl["ESysDt"] + "' " + "\n";

            
            DataTable dt = DBHelper.GetDataTable(sql);

            return dt;
            //if (htAprvl["SysNo"] != null && htAprvl["SysNo"].ToString() != "")
            //    sql = sql + "       AND SysNo = '" + htAprvl["SysNo"] + "' ";
            //if (dt.Rows.Count > 0)
            //{
            //    Hashtable rhtAprvl = new Hashtable();
            //    rhtAprvl["SysNo"] = dt.Rows[0][0];
            //    rhtAprvl["ReceiptFlg"] = dt.Rows[0][1];
            //    rhtAprvl["SubmitPsn"] = dt.Rows[0][2];
            //    rhtAprvl["SubmitDt"] = dt.Rows[0][3];
            //    rhtAprvl["AprvlPsn"] = dt.Rows[0][4];
            //    rhtAprvl["AprvlDt"] = dt.Rows[0][5];
            //    rhtAprvl["AprvlStatus"] = dt.Rows[0][6];
            //    rhtAprvl["AprvlLvl"] = dt.Rows[0][7];

            //    return rhtAprvl;
            //}
            //else
            //    return null;
        }
        /// <summary>
        /// 检查审批是否完成
        /// </summary>
        /// <param name="htAprvl">审批状态，单据标志，单据号</param>
        /// <returns></returns>
        public static Boolean ChkFinishAprvl(Hashtable htAprvl)
        {
            
            String sql = "";
            sql = sql + "SELECT * " + "\n";
            sql = sql + "FROM   wcsy_Approval " + "\n";
            sql = sql + "WHERE  AprvlStatus = '" + htAprvl["AprvlStatus"] + "' " + "\n";
            sql = sql + "       AND ReceiptFlg = '" + htAprvl["ReceiptFlg"] + "' " + "\n";
            sql = sql + "       AND SysNo = '" + htAprvl["SysNo"] + "' " + "\n";

            
            DataTable dt = DBHelper.GetDataTable(sql);

            if (dt.Rows.Count > 0)
                return false;
            else
                return true;
        }

        #endregion

        //#region 下拉选项

        ///// <summary>
        ///// 添加下拉选项
        ///// </summary>
        ///// <param name="htCbi">下拉选项数据模型</param>
        ///// <returns></returns>
        //public static int AddCombItem(Hashtable htCbi)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "INSERT INTO wcsy_CombItem " + "\n";
        //    sql = sql + "VALUES      ('" + htCbi["CombName"] + "', " + "\n";
        //    sql = sql + "             '" + htCbi["ItemName"] + "', " + "\n";
        //    sql = sql + "             NULL) ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 删除对应代码的下拉选项
        ///// </summary>
        ///// <param name="ReqTpNo">下拉选项序号</param>
        ///// <returns></returns>
        //public static int DelCombItemByNo(string id)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "DELETE wcsy_CombItem " + "\n";
        //    sql = sql + "WHERE  id = '" + id + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 修改对应代码的下拉选项信息
        ///// </summary>
        ///// <param name="htCbi">下拉选项数据模型</param>
        ///// <returns></returns>
        //public static int ModifyCombItemByNo(Hashtable htCbi)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "UPDATE wcsy_CombItem " + "\n";
        //    sql = sql + "SET    CombName = '" + htCbi["CombName"] + "', ";
        //    sql = sql + "       ItemName = '" + htCbi["ItemName"] + "', ";
        //    sql = sql + "       ItemValue = NULL ";
        //    sql = sql + "WHERE  id = '" + htCbi["id"] + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        ///// <summary>
        ///// 获取对应代码的下拉选项信息
        ///// </summary>
        ///// <param name="id">下拉选项序号</param>
        ///// <returns></returns>
        //public static Hashtable GetCombItemByNo(string id)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_CombItem " + "\n";
        //    sql = sql + "WHERE  id = '" + id + "' ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    if (dt.Rows.Count > 0)
        //    {
        //        Hashtable htCbi = new Hashtable();
        //        htCbi["id"] = dt.Rows[0][0];
        //        htCbi["CombName"] = dt.Rows[0][1];
        //        htCbi["ItemName"] = dt.Rows[0][2];
        //        htCbi["ItemValue"] = dt.Rows[0][3];

        //        return htCbi;
        //    }
        //    else
        //        return null;
        //}
        ///// <summary>
        ///// 查询下拉选项信息
        ///// </summary>
        ///// <param name="htCbi">查询条件</param>
        ///// <returns></returns>
        //public static DataTable GetCombItemByCdt(Hashtable htCbi)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * " + "\n";
        //    sql = sql + "FROM   wcsy_CombItem " + "\n";
        //    sql = sql + "WHERE  1 = 1 " + "\n";

        //    if (htCbi["ItemName"] != null)
        //        sql = sql + "       AND ItemName = '" + htCbi["ItemName"] + "' " + "\n";

        //    if (htCbi["CombName"] != null && htCbi["CombName"].ToString() != "")
        //        sql = sql + "       AND CombName = '" + htCbi["CombName"] + "' " + "\n";

        //    sql = sql + "ORDER  BY CombName, " + "\n";
        //    sql = sql + "          ItemName ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);

        //    return dt;
        //}

        //#endregion

        #region 日志

        /// <summary>
        /// 新增日志
        /// </summary>
        /// <param name="alm">日志类数据模型</param>
        /// <returns></returns>
        //public static int AddActivityLog(ActivityLogModel alm)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "INSERT INTO wcsy_ActivityLog " + "\n";
        //    sql = sql + "VALUES     ('" + alm.ReceiptType + "', " + "\n";
        //    sql = sql + "            '" + alm.SysNo + "', " + "\n";
        //    sql = sql + "            '" + alm.RMAorDOANo + "', " + "\n";
        //    sql = sql + "            '" + alm.Operator + "', " + "\n";
        //    sql = sql + "            '" + alm.OperType + "', " + "\n";
        //    sql = sql + "            '" + DateTime.Now + "', " + "\n";
        //    sql = sql + "            '" + alm.Remark + "') ";

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        /// <summary>
        /// 删除日志
        /// </summary>
        /// <param name="alm">日志类数据模型</param>
        /// <returns></returns>
        //public static int DelActivityLog(Hashtable HtAlm)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "DELETE wcsy_ActivityLog " + "\n";
        //    sql = sql + "WHERE  1 = 1 " + "\n";

        //    if (HtAlm != null)
        //    {
        //        if (HtAlm["ReceiptType"] != null && HtAlm["ReceiptType"].ToString() != "")
        //            sql = sql + "       AND ReceiptType = '" + HtAlm["ReceiptType"] + "' " + "\n";

        //        if (HtAlm["SysNo"] != null && HtAlm["SysNo"].ToString() != "")
        //            sql = sql + "       AND SysNo = '" + HtAlm["SysNo"] + "' " + "\n";

        //        if (HtAlm["RMAorDOANo"] != null && HtAlm["RMAorDOANo"].ToString() != "")
        //            sql = sql + "       AND RMAorDOANo = '" + HtAlm["RMAorDOANo"] + "' " + "\n";

        //        if (HtAlm["Operator"] != null && HtAlm["Operator"].ToString() != "")
        //            sql = sql + "       AND Operator = '" + HtAlm["Operator"] + "' " + "\n";

        //        if (HtAlm["OperType"] != null && HtAlm["OperType"].ToString() != "")
        //            sql = sql + "       AND OperType = '" + HtAlm["OperType"] + "' " + "\n";

        //        if (HtAlm["SExecDt"] != null && HtAlm["SExecDt"].ToString() != "")
        //            sql = sql + "       AND ExecDt >= '" + HtAlm["SExecDt"] + "' " + "\n";

        //        if (HtAlm["EExecDt"] != null && HtAlm["EExecDt"].ToString() != "")
        //            sql = sql + "       AND ExecDt <= '" + HtAlm["EExecDt"] + "' " + "\n";

        //        if (HtAlm["Remark"] != null && HtAlm["Remark"].ToString() != "")
        //            sql = sql + "       AND Remark = '" + HtAlm["Remark"] + "' " + "\n";

        //    }
        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    int i = db.ExecuteNonQuery(com);

        //    return i;
        //}
        /// <summary>
        /// 查询日志
        /// </summary>
        /// <param name="alm">日志类数据模型</param>
        /// <returns></returns>
        //public static DataTable GetActivityLog(Hashtable HtAlm)
        //{
        //    DBHelper db = new DBHelper();

        //    String sql = "";
        //    sql = sql + "SELECT * FROM wcsy_ActivityLog " + "\n";
        //    sql = sql + "WHERE  1 = 1 " + "\n";

        //    if (HtAlm != null)
        //    {
        //        if (HtAlm["ReceiptType"] != null && HtAlm["ReceiptType"].ToString() != "")
        //            sql = sql + "       AND ReceiptType = '" + HtAlm["ReceiptType"] + "' " + "\n";

        //        if (HtAlm["SysNo"] != null && HtAlm["SysNo"].ToString() != "")
        //            sql = sql + "       AND SysNo = '" + HtAlm["SysNo"] + "' " + "\n";

        //        if (HtAlm["RMAorDOANo"] != null && HtAlm["RMAorDOANo"].ToString() != "")
        //            sql = sql + "       AND RMAorDOANo = '" + HtAlm["RMAorDOANo"] + "' " + "\n";

        //        if (HtAlm["Operator"] != null && HtAlm["Operator"].ToString() != "")
        //            sql = sql + "       AND Operator = '" + HtAlm["Operator"] + "' " + "\n";

        //        if (HtAlm["OperType"] != null && HtAlm["OperType"].ToString() != "")
        //            sql = sql + "       AND OperType = '" + HtAlm["OperType"] + "' " + "\n";

        //        if (HtAlm["SExecDt"] != null && HtAlm["SExecDt"].ToString() != "")
        //            sql = sql + "       AND ExecDt >= '" + HtAlm["SExecDt"] + "' " + "\n";

        //        if (HtAlm["EExecDt"] != null && HtAlm["EExecDt"].ToString() != "")
        //            sql = sql + "       AND ExecDt <= '" + HtAlm["EExecDt"] + "' " + "\n";

        //        if (HtAlm["Remark"] != null && HtAlm["Remark"].ToString() != "")
        //            sql = sql + "       AND Remark = '" + HtAlm["Remark"] + "' " + "\n";
        //    }

        //    DbCommand com = db.GetSqlStringCommond(sql);
        //    DataTable dt = db.ExecuteDataTable(com);
        //    return dt;
        //}

        #endregion
    }
}
